define(['text!service/warrantyCard.html'],
	function(viewTemplate) {
		return Piece.View.extend({
			id: 'service_warrantyCard',

			events: {
				"click #submit": "submit",
				"click #submit2": "submit2",
				"click #submit3": "submit3",
			},
			render: function() {
				$(this.el).html(viewTemplate);

				Piece.View.prototype.render.call(this);
				return this;
			},
			onShow: function() {
				//write your business logic here :)


				var windowHeight = $(window).height();
				var elTop = $("#warrantyCard").offset().top;
				var elHeight = windowHeight - elTop - 35;

				console.info(elHeight);
				$("#warrantyCard").css({
					"height": elHeight
				});
				new iScroll($("#warrantyCard")[0]);
			},
			submit: function() {


				this.container.navigateForResult('/service/warrantyCard2', {
					trigger: true
				}, 'service/warrantyCard', this.onGotResult);
			},

			submit2: function() {

				var recommend = document.getElementById("img2");
				recommend.style.display = 'block';


			},

			submit3: function() {

				var recommend = document.getElementById("img3");
				recommend.style.display = 'block';
			}
		}); //view define

	});